import request, { Get, Post } from "./request"
    
// 获取新闻分类
export const getNewCategoryListApi = (params?:any)=>Get('/prod-api/press/category/list',params)

// 获取新闻列表
export const getNewsListApi = (params?:any)=>Get('/prod-api/press/press/list',params)

// 获取新闻详情
export const getNewDetailApi = (id?:string)=>request({
    url:'/prod-api/press/press/'+id,
    method:"GET",
})

// 新闻点赞
export const addLikeToNewApi = (id?:string)=>request({
    url:'/prod-api/press/press/like/'+id,
    method:"PUT",
})

// 获取新闻列表
export const getCommentListApi = (params?:any) => Get('/prod-api/press/comments/list',params)

// 评论点赞
export const addLikeToNewCommentApi = (id?:string)=>request({
    url:'/prod-api/press/pressComment/like/'+id,
    method:"PUT",
})

// 发布评论
export const addCommentToNewAPI = (data?:any) => Post('/prod-api/press/pressComment',data)